package com.self.cgqcompose.ui.components.areacode

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import coil.compose.AsyncImage
import com.self.cgqcompose.beans.AreaBlock

@Composable
fun AreaCode73(data: AreaBlock) {
    LazyRow(modifier = Modifier.padding(horizontal = 10.dp),
        horizontalArrangement = Arrangement.spacedBy(10.dp)) {
        items(data.data.data.size) { index ->
            Row(verticalAlignment = Alignment.CenterVertically,
                modifier = Modifier.background(Color(0xFFEEEEEE), RoundedCornerShape(5.dp))
                    .padding(horizontal = 3.dp, vertical = 5.dp)) {
                AsyncImage(model = data.data.data[index].cover, contentDescription = null)
                Text(text = data.data.data[index].title, modifier = Modifier.padding(start = 5.dp),
                    fontSize = 13.sp)
            }
        }
    }
}